Skip to main content

4G/5G

This guide describes how to use 4G/5G modules on the NG4500-CB01 platform, using the Quectel EM05 (4G) and RM520N-GL (5G) as examples. Both modules are supported by pre-installed drivers in mainstream Linux systems and require no additional installation.

Serial Port Tool

A serial port tool is used for AT command set. It is recommended to use minicom

$ sudo apt-get install minicom

Using the EM05 (4G) Module

1. Identify drivers

After inserting the module, check whether it is recognized with lsusb :

Bus 001 Device 004: ID 2c7c:030e Quectel Wireless Solutions Co., Ltd. Quectel EM05-G

Check the serial port nodes via(dmesg),Typically, four/dev/ttyUSB*devices will appear, with ttyUSB2 used for AT commands:

[   11.224317] usbserial: USB Serial support registered for GSM modem (1-port)
[ 11.224419] option 1-2.3:1.0: GSM modem (1-port) converter detected
[ 11.224595] usb 1-2.3: GSM modem (1-port) converter now attached to ttyUSB0
[ 11.224653] option 1-2.3:1.1: GSM modem (1-port) converter detected
[ 11.224763] usb 1-2.3: GSM modem (1-port) converter now attached to ttyUSB1
[ 11.224811] option 1-2.3:1.2: GSM modem (1-port) converter detected
[ 11.225863] usb 1-2.3: GSM modem (1-port) converter now attached to ttyUSB2
[ 11.225951] option 1-2.3:1.3: GSM modem (1-port) converter detected
[ 11.227422] usb 1-2.3: GSM modem (1-port) converter now attached to ttyUSB3

2. AT Command Set

Open a serial terminal to send AT commands:

$ sudo minicom -D /dev/ttyUSB2

Common AT commands include:

ati              Check the module model and firmware version
at+cpin?         Check SIM card status
at+csq           Check whether the SIM card is present
at+cops          Check the current operator
at+creg?         Get network registration status (0,1 means registered)

3. Connect to Network and Testing

Ubuntu’s Network Manager will automatically recognize and connect the network. You can also manually configure it through the graphical user interface, as shown in the figure below.

EM05_network_configuration.png

Use the ifconfig command to verify network status:

enx12849acd283b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
inet 192.168.225.26 netmask 255.255.255.0 broadcast 192.168.225.255
inet6 2409:8934:20d1:2d63:849f:fe7:583d:664c prefixlen 64 scopeid 0x0<global>
inet6 2409:8934:20d1:2d63:cee5:ca58:9917:456b prefixlen 64 scopeid 0x0<global>
inet6 fe80::ebb7:1cbd:5f8d:93a1 prefixlen 64 scopeid 0x20<link>
ether 12:84:9a:cd:28:3b txqueuelen 1000 (Ethernet)
RX packets 11732 bytes 14718060 (14.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9674 bytes 811730 (811.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Use ping to verify external network connectivity:

$ ping -I enx12849acd283b www.baidu.com
PING www.baidu.com(2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c)) from 2409:8934:20d1:2d63:849f:fe7:583d:664c enx12849acd283b: 56 data bytes
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=1 ttl=48 time=49.1 ms
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=2 ttl=48 time=50.4 ms
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=3 ttl=48 time=43.9 ms

Using the RM520N-GL (5G) Module

1. Identify drivers

After inserting the module, check whether it is recognized with lsusb :

Bus 002 Device 003: ID 2c7c:0801 Quectel Wireless Solutions Co., Ltd. RM520N-GL

Check the serial port nodes via(dmesg),Typically, four  /dev/ttyUSB*devices will appear, with ttyUSB2 used for AT command:

[    9.209315] option 2-1.3:1.0: GSM modem (1-port) converter detected
[ 9.214898] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB0
[ 9.214989] option 2-1.3:1.1: GSM modem (1-port) converter detected
[ 9.215167] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB1
[ 9.215211] option 2-1.3:1.2: GSM modem (1-port) converter detected
[ 9.215319] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB2
[ 9.215368] option 2-1.3:1.3: GSM modem (1-port) converter detected
[ 9.215450] usb 2-1.3: GSM modem (1-port) converter now attached to ttyUSB3

2. AT Command set

Open the serial terminal::

$ sudo minicom -D /dev/ttyUSB2

After entering Minicom, press Ctrl+A, then E to enable or disable echo. If OK is returned after entering AT, the module is functioning correctly. Proceed with debugging using the following commands.

Common AT commands:

ATI                         Check module information
AT+CPIN? Check SIM card status
AT+C5GREG? Check 5G network registration status (should return 0,1 or 0,5)
AT+QENG="servingcell" Check operator information
AT+CGPADDR=1 Check if the first PDP context has an IP address
AT+CGACT=1,1 Activate the first PDP context if no IP is assigned
AT+QCFG="usbnet" Query USB network mode

Sample output:

Welcome to minicom 2.8

OPTIONS: I18n
Port /dev/ttyUSB2, 09:50:32

Press CTRL-A Z for help on special keys


Quectel
RM520N-GL
Revision: RM520NGLAAR01A08M4G

OK

+CPIN: READY

OK

+C5GREG: 0,1

OK

+QENG: "servingcell","NOCONN","NR5G-SA","TDD",460,00,203959107,575,3259E7,504990,41,3,-116,-12,12,1,4

OK

+CGPADDR: 1,"10.131.145.127","36.9.137.52.32.194.251.231.24.28.238.148.193.140.209.180"

OK

+QCFG: "usbnet",1

OK

After verification, press Ctrl+A followed by X, then select Yes to exit.

3. Enable 5G module to connect to the network(Recommended: ECM)

Enter the AT command to query the current network status:

AT+QCFG="usbnet"

Type the following commands to set the module to ECM mode (highly recommended for Linux):

AT+QCFG="usbnet",1 
AT+CFUN=1,1

Definitions:

CommandDescription
AT+QCFG="usbnet",0NDIS(QMI)
AT+QCFG="usbnet",1ECM(recommended)
AT+QCFG="usbnet",2MBIM
AT+QCFG="usbnet",5NCM

4. Checking and Testing

After restarting the module, ECM registration can be observed indmesg :

[    9.206605] cdc_ether 2-1.3:1.10 usb0: register 'cdc_ether' at usb-3610000.usb-1.3, CDC Ethernet Device, 7a:a8:fd:a4:36:d1

Use the ifconfig command to verify network interfaces:

$ sudo ifconfig 
enx7aa8fda436d1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.225.94 netmask 255.255.255.0 broadcast 192.168.225.255
inet6 2409:8934:20c2:fbe7:bc33:5fcd:fd07:f46b prefixlen 64 scopeid 0x0<global>
inet6 fe80::df81:1f32:7692:e058 prefixlen 64 scopeid 0x20<link>
inet6 2409:8934:20c2:fbe7:4430:9c7e:4027:7637 prefixlen 64 scopeid 0x0<global>
ether 7a:a8:fd:a4:36:d1 txqueuelen 1000 (Ethernet)
RX packets 12581 bytes 15549574 (15.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9243 bytes 773976 (773.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Use ping to verify external network connectivity:

$ ping -I enx7aa8fda436d1 www.baidu.com
PING www.baidu.com(2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c)) from 2409:8934:20c2:fbe7:4430:9c7e:4027:7637 enx7aa8fda436d1: 56 data bytes
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=1 ttl=47 time=44.6 ms
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=2 ttl=47 time=64.1 ms
64 bytes from 2409:8c20:6:1135:0:ff:b027:210c (2409:8c20:6:1135:0:ff:b027:210c): icmp_seq=3 ttl=47 time=107 ms

For other brands or models of 4G/5G modules, refer to the corresponding vendor documentation and official driver instructions